#ifndef __CFORCE__REGISTER
#define __CFORCE__REGISTER
#include "..\Includes\IForceRegister.h"
#include "..\Includes\IPhysics.h"
#include "CEntity.h"
#include <vector>
#include "IForceGenerator.h"

namespace Core{

class CForceRegister: public IForceRegister
{
public:
	virtual void add(IEntity * entity,int forceGeneratorId);
	virtual void remove(IEntity * entity,int forceGeneratorId);
	virtual void clear();
private:
	CForceRegister();
	static CForceRegister* forceRegisterInstance;
	struct ForceRegistration
	{
		CEntity * entity;
		int forceGeneratorId;
	};
	typedef std::vector<ForceRegistration> Registry;
	Registry registrations;
	std::vector<IForceGenerator *> forceGenerators;

public:
	static CForceRegister * getForceRegisterInstance();
  static void destroy();
	void update(real dT);
	int addForceGenerator(IForceGenerator *);
	
	
};
}

#endif